home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d26
/
inf_src.arc
/
WEKNOW.C
< prev
Wrap
C/C++ Source or Header
|
1986-03-14
|
2KB
|
66 lines
/*****************************************************************
** **
** Inference -- (C) Copyright 1985 George Hageman **
** **
** user-supported software: **
** **
** George Hageman **
** P.O. Box 11234 **
** Boulder, Colorado 80302 **
** **
*****************************************************************/
/*****************************************************************
**
** weKnow(antecedent,&predicate)
**
** routines searches both knownTrue and knownFalse
** stacks to determine whether the antecedent is known.
**
** the return value of the routine is TRUE if known and FALSE otherwise
**
** the predicate is set to the "true" value of the antecedent according
** to whether its phase is TRUE or FALSE and its .flag indicator.
**
*****************************************************************/
#include "expert.h"
#include "inference.h"
int weKnow(antecedent,p_value)
int antecedent,*p_value ;
{
if(known(antecedent,knownTrue,numTrue) == TRUE )
switch(ruleBuff[antecedent].flag)
{
case STRING_TRUE:
case STRING_TRUE_HYP:
case ROUTINE_TRUE:
case ROUTINE_TRUE_HYP:
*p_value = TRUE ;
return(TRUE) ;
case STRING_FALSE:
case ROUTINE_FALSE :
*p_value = FALSE ;
return(TRUE) ;
}
if(known(antecedent,knownFalse,numFalse) == TRUE )
switch(ruleBuff[antecedent].flag)
{
case STRING_TRUE:
case STRING_TRUE_HYP:
case ROUTINE_TRUE:
case ROUTINE_TRUE_HYP :
*p_value = FALSE ;
return(TRUE) ;
case STRING_FALSE:
case ROUTINE_FALSE:
*p_value = TRUE ;
return(TRUE) ;
}
return(FALSE) ;
}